<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AlterActivityPrizesTable extends Migration
{
    const TABLE = 'activity_prizes';

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        if (Schema::hasTable(self::TABLE)) {
            Schema::table(self::TABLE, function (Blueprint $table) {
                $table->addColumn('Integer', 'is_recycle', ['length' => 1])->default(0);
            });
        }
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        if (Schema::hasColumn(self::TABLE, 'is_recycle')) {
            Schema::table(self::TABLE, function (Blueprint $table) {
                $table->dropColumn('is_recycle');
            });
        }
    }
}
